<?php   
/********************************************
*
********************************************/

class Articles extends Controller {

	function Articles()
	{
		parent::Controller();	
        $this->load->model('articlesmodel'); 
	}
	
    function index()
    {                                                                      

        //load page description
        $this->load->model('pageheadersmodel'); 
        $data["header"] = $this->pageheadersmodel->get_header('articles'); 

        //articles list                                          
        $data["grouped_list"] = $this->articlesmodel->get_list();                                                   

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Articles")); 
        $this->load->view('website/default/header');  
        $this->load->view('website/articles/articles', $data);   
        $this->load->view('website/default/footer');   

    }

    function month($month = '')
    {                                                                      

        //load page description
        $this->load->model('pageheadersmodel'); 
        $data["pagedescritpion"] = $this->pageheadersmodel->get_header('articles'); 

        //articles list
        $data["grouped_list"] = $this->articlesmodel->get_list($month); 
        if (empty($data["grouped_list"])) show_404(); 

        //activate layout variant for 'month page'
        $data["use_month_layout"] = TRUE;

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Articles")); 
        $this->load->view('website/default/header');  
        $this->load->view('website/articles/articles', $data);   
        $this->load->view('website/default/footer');   

    }

    function view($id = NULL)
    {
                                                               
        $this->load->model('glossarymodel'); 

        //articles item
        $data["articles_item"] = $this->articlesmodel->get_item($id); 
        if (empty($data["articles_item"])) show_404();                                              

        //articles list
        $data["grouped_list"] = $this->articlesmodel->get_list();      

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Articles - " . $data["articles_item"]["Title_Articles"])); 
        $this->load->view('website/default/header');  
        $this->load->view('website/articles/articles_detail', $data);   
        $this->load->view('website/default/footer');   

    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */